Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODClipboard


ShowPasteAsDialog

The ShowPasteAsDialog method displays the Paste As dialog box and sets the appropriate dialog items according to the input parameters.

ODBoolean ShowPasteAsDialog (
                     in ODBoolean canPasteLink, 
                     in ODPasteAsMergeSetting mergeSetting, 
                     in ODFacet facet, 
                     in ODTypeToken viewType, 
                     out ODPasteAsResult theResult);
canPasteLink
kODTrue if the destination part allows a link to be created, otherwise kODFalse.
mergeSetting
A value indicating whether embedding and merging are supported; determines the initial setting for the At the Destination radio buttons.
facet
A reference to the facet from which the Paste As dialog box is triggered.
viewType
A tokenized string representing the initial setting for the view type of the embedded part (if embedding is chosen).
theResult
A structure reflecting the user's selections in the Paste As dialog box.
return value
kODTrue if the user clicked OK to leave the Paste As dialog box, otherwise kODFalse.
DISCUSSION
You should call this method in your part's HandleEvent method to display the Paste As dialog box when the user selects Paste As from the Edit menu.

If the canPasteLink parameter is true, and if the content storage unit contains a link specification and the draft permissions allow writing, then the Paste with Link checkbox is checked.

The mergeSetting parameter specifies which At the Destination radio button (Merge with Contents or Embed As) is initially selected in the Paste As dialog box and whether the other button is available. It must be one of the following:

The viewType parameter must be the tokenized form of one of the view-type constants (kODViewAsFrame, kODViewAsLargeIcon, kODViewAsSmallIcon, or kODViewAsThumbnail). You can call the session object's Tokenize method to obtain a token corresponding to one of these constants.

If the user clicks OK, this method returns true and sets the fields of the output parameter, theResult, to indicate the selections the user made in the Paste As dialog box. You must dispose of the non-null selectedKind, translateKind, and editor fields of the theResult structure when you are finished using them.

If the user cancels the dialog box, this method returns false and you do not need to take any further action.

EXCEPTIONS
kODErrNullFacetInput
The facet parameter is null.
kODErrNullPasteAsResultInput
The theResult parameter is null.
kODErrOutOfMemory
There is not enough memory to complete the operation.
SEE ALSO
The ODPasteAsResult type (page 918).
The ODTypeToken type (page 877).
The ODSession::Tokenize method (page 622).
"Paste As" on page 250 in OpenDoc Programmer's Guide.
"Handling the Paste As Dialog Box" on page 337 in OpenDoc Programmer's Guide.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help